import { TRuneUpgrade } from "../../../Message/Db/Tables/TRuneUpgrade";
import { ObjectParser } from "../../../com/gengine/utils/ObjectParser";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class RuneUpgradeConfig
    
    export  class RuneUpgradeConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (RuneUpgradeConfig._instance != null) 
            {
                throw new Error(" RuneUpgradeConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TRuneUpgrade();
                ObjectParser.putObject(loc2, loc1);
                this._map[loc2.runeCode] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_rune_upgrade.json");
            this.write(loc1);
            return;
        }

        public getInfoByCode(arg1: int): TRuneUpgrade
        {
            return this._map[arg1];
        }

        public static get instance(): RuneUpgradeConfig
        {
            if (RuneUpgradeConfig._instance == null) 
            {
                RuneUpgradeConfig._instance = new RuneUpgradeConfig();
            }
            return RuneUpgradeConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: RuneUpgradeConfig;
    }
